/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package plum.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import plum.NameAction;
import plum.PlumPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Name Action</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link plum.impl.NameActionImpl#getNameValueQuery <em>Name Value Query</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class NameActionImpl extends ActionImpl implements NameAction {
	/**
	 * The default value of the '{@link #getNameValueQuery() <em>Name Value Query</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNameValueQuery()
	 * @generated
	 * @ordered
	 */
	protected static final String NAME_VALUE_QUERY_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getNameValueQuery() <em>Name Value Query</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNameValueQuery()
	 * @generated
	 * @ordered
	 */
	protected String nameValueQuery = NAME_VALUE_QUERY_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected NameActionImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return PlumPackage.Literals.NAME_ACTION;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getNameValueQuery() {
		return nameValueQuery;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNameValueQuery(String newNameValueQuery) {
		String oldNameValueQuery = nameValueQuery;
		nameValueQuery = newNameValueQuery;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, PlumPackage.NAME_ACTION__NAME_VALUE_QUERY, oldNameValueQuery, nameValueQuery));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case PlumPackage.NAME_ACTION__NAME_VALUE_QUERY:
				return getNameValueQuery();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case PlumPackage.NAME_ACTION__NAME_VALUE_QUERY:
				setNameValueQuery((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case PlumPackage.NAME_ACTION__NAME_VALUE_QUERY:
				setNameValueQuery(NAME_VALUE_QUERY_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case PlumPackage.NAME_ACTION__NAME_VALUE_QUERY:
				return NAME_VALUE_QUERY_EDEFAULT == null ? nameValueQuery != null : !NAME_VALUE_QUERY_EDEFAULT.equals(nameValueQuery);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (nameValueQuery: ");
		result.append(nameValueQuery);
		result.append(')');
		return result.toString();
	}

} //NameActionImpl
